Skip to content

UI General fix#4086

Merged
marinofaggiana merged 1 commit into
masterfrom
UI-Fix
Apr 26, 2026
Merged

UI General fix#4086
marinofaggiana merged 1 commit into
masterfrom
UI-Fix

Conversation

@marinofaggiana
Copy link
Copy Markdown
Member

@marinofaggiana marinofaggiana commented Apr 24, 2026

  • Fix show Banner with timer

Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
@marinofaggiana marinofaggiana marked this pull request as draft April 24, 2026 08:55
@mpivchev mpivchev requested a review from Copilot April 24, 2026 09:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the app’s banner error “de-duplication” logic by replacing the previous global shownErrors tracking with a time-based, per-error (optionally per-account) cooldown gate, and bumps the app’s marketing version.

Changes:

  • Bump MARKETING_VERSION to 33.0.8 in the Xcode project.
  • Remove the global shownErrors mechanism and its clearing points in app lifecycle/networking.
  • Introduce ErrorBannerGate (actor) and use it to throttle repeated banners in the Lucid Banner helpers.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
Nextcloud.xcodeproj/project.pbxproj Updates version/build settings (marketing version + project version).
iOSClient/Networking/NCNetworkingProcess.swift Removes foreground-session error clearing tied to the old shownErrors mechanism.
iOSClient/NCAppStateManager.swift Removes global shownErrors and background clear of that state.
iOSClient/GUI/Lucid Banner/WarningBannerView.swift Switches banner spam prevention from bannerContainsError to ErrorBannerGate.
iOSClient/GUI/Lucid Banner/ShowBanner.swift Switches banner spam prevention from bannerContainsError to ErrorBannerGate.
iOSClient/GUI/Lucid Banner/InfoBannerView.swift Switches banner spam prevention from bannerContainsError to ErrorBannerGate.
iOSClient/GUI/Lucid Banner/HelperBanner.swift Adds ErrorBannerGate actor implementing cooldown-based gating.
iOSClient/GUI/Lucid Banner/ErrorBannerView.swift Switches error banner gating to ErrorBannerGate (and removes previous cancellation/skip handling).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 5;
CURRENT_PROJECT_VERSION = 0;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 5;
CURRENT_PROJECT_VERSION = 0;
Comment on lines +32 to +34
if let errorCode,
let controller = SceneManager.shared.getController(scene: windowScene) {
if await !ErrorBannerGate.shared.shouldShow(errorCode: errorCode, account: controller.account) {
Comment on lines 20 to 37
func showErrorBanner(windowScene: UIWindowScene?,
title: String = "_error_",
text: String,
footnote: String? = nil,
errorCode: Int? = nil,
afError: AFError? = nil) async {
guard let windowScene,
let window = windowScene.windows.first(where: \.isKeyWindow) else {
return
}

#if !EXTENSION
guard !bannerContainsError(errorCode: errorCode, afError: afError) else {
return
if let errorCode,
let controller = SceneManager.shared.getController(scene: windowScene) {
if await !ErrorBannerGate.shared.shouldShow(errorCode: errorCode, account: controller.account) {
return
}
}
Comment on lines +35 to +37
if let errorCode,
let controller = SceneManager.shared.getController(scene: windowScene) {
if await !ErrorBannerGate.shared.shouldShow(errorCode: errorCode, account: controller.account) {
Comment on lines +22 to +24
if let errorCode,
let controller = SceneManager.shared.getController(scene: windowScene) {
if await !ErrorBannerGate.shared.shouldShow(errorCode: errorCode, account: controller.account) {
Comment on lines +24 to +26
if let errorCode,
let controller = SceneManager.shared.getController(scene: windowScene) {
if await !ErrorBannerGate.shared.shouldShow(errorCode: errorCode, account: controller.account) {
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors banner deduplication to avoid repeatedly showing the same error banners, replacing the previous global shownErrors mechanism with a new ErrorBannerGate actor-based cooldown approach, and updates the banner presentation entry points to consult this gate.

Changes:

  • Remove the global shownErrors state and its clearing logic from app lifecycle/networking code.
  • Add ErrorBannerGate actor with per-error (optionally per-account) cooldown behavior and use it from banner presentation helpers.
  • Bump MARKETING_VERSION to 33.0.8 (but also changes build number settings).

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
iOSClient/Networking/NCNetworkingProcess.swift Removes legacy clearing of the old shownErrors set.
iOSClient/NCAppStateManager.swift Removes global shownErrors definition and background reset logic.
iOSClient/GUI/Lucid Banner/WarningBannerView.swift Switches suppression logic to ErrorBannerGate.
iOSClient/GUI/Lucid Banner/ShowBanner.swift Switches suppression logic to ErrorBannerGate for generic banners.
iOSClient/GUI/Lucid Banner/InfoBannerView.swift Switches suppression logic to ErrorBannerGate.
iOSClient/GUI/Lucid Banner/HelperBanner.swift Introduces the new ErrorBannerGate actor implementation.
iOSClient/GUI/Lucid Banner/ErrorBannerView.swift Switches suppression logic to ErrorBannerGate for error banners.
Nextcloud.xcodeproj/project.pbxproj Updates marketing version and modifies project version/build number settings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +24 to 30
if let errorCode,
let controller = SceneManager.shared.getController(scene: windowScene) {
if await !ErrorBannerGate.shared.shouldShow(errorCode: errorCode, account: controller.account) {
return
}
}
#endif
Comment on lines +35 to 41
if let errorCode,
let controller = SceneManager.shared.getController(scene: windowScene) {
if await !ErrorBannerGate.shared.shouldShow(errorCode: errorCode, account: controller.account) {
return(nil, nil)
}
}
#endif
Comment on lines +22 to 28
if let errorCode,
let controller = SceneManager.shared.getController(scene: windowScene) {
if await !ErrorBannerGate.shared.shouldShow(errorCode: errorCode, account: controller.account) {
return
}
}
#endif
Comment on lines +160 to +180
private func cooldownInterval(for errorCode: Int) -> TimeInterval {
switch errorCode {

case NSURLErrorNotConnectedToInternet:
return 30 // No internet connection (persistent until network changes)

case NSURLErrorCannotFindHost:
return 30 // Host/DNS not reachable (likely server down or misconfigured URL)

case 401:
return 30 // Unauthorized (server maintenance)

case 423:
return 20 // Resource locked (temporary server-side condition)

case 507:
return 30 // Insufficient storage (server quota exceeded, persistent)

default:
return 5 // Transient or unknown error
}
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 5;
CURRENT_PROJECT_VERSION = 0;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 5;
CURRENT_PROJECT_VERSION = 0;
Comment on lines 31 to 38
#if !EXTENSION
guard !bannerContainsError(errorCode: errorCode, afError: afError) else {
return
if let errorCode,
let controller = SceneManager.shared.getController(scene: windowScene) {
if await !ErrorBannerGate.shared.shouldShow(errorCode: errorCode, account: controller.account) {
return
}
}
#endif
Comment on lines +32 to 38
if let errorCode,
let controller = SceneManager.shared.getController(scene: windowScene) {
if await !ErrorBannerGate.shared.shouldShow(errorCode: errorCode, account: controller.account) {
return
}
}
#endif
@marinofaggiana marinofaggiana marked this pull request as ready for review April 24, 2026 14:10
@marinofaggiana marinofaggiana requested a review from mpivchev April 24, 2026 14:11
@marinofaggiana marinofaggiana merged commit 5213ea0 into master Apr 26, 2026
17 checks passed
@marinofaggiana marinofaggiana deleted the UI-Fix branch April 26, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants